import React, { Component} from 'react';

export default class OrderUnit extends Component {
    render(){
        const {imgPath,orderName,details,price,num,stock,index} = this.props
        return(
            <div>
                {
                    index==0 ?
                        <div className="flex flex-pack-justify plAll bor_dashes">
                            <div className="flex f14">
                                <div style={{width:50,height:50}}><img src={imgPath} alt=""/></div>
                                <div className="ml1">
                                    <div><span className="color6">{orderName}</span ></div>
                                    <div className="colorlv">￥{price}</div>
                                    {/*<div className="color9 mt">{details}</div>*/}
                                </div>
                            </div>
                            <div className="color6 f12">
                                {/*<div className={stock<num?"colorlv":"color6"}>代管库存：{stock}</div>*/}
                                <div className="tr">当前数量：{num}</div>
                            </div>
                        </div>
                        :
                        <div className="flex flex-pack-justify plAll bor_dashes">
                            <div className="flex f14">
                                <div style={{width:50,height:50}}><img src={imgPath} alt=""/></div>
                                <div className="ml1">
                                    <div><span className="color6">{orderName}</span ></div>
                                    {/*<div className="color9 mt">{details}</div>*/}
                                </div>
                            </div>
                            <div className="color6 f12">
                                <div className="colorlv">￥{price}</div>
                                <div className="tr">X{num}</div>
                            </div>
                        </div>
                }
            </div>
        )
    }

}